/*
package com.gaofei.sysmanager.kafka;

import com.gaofei.sysmanager.common.MsgUtil;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

*/
/**
 * @Auther: 86156
 * @Date: 2021/11/4 10:20
 * @Description:
 *//*

@Component
public class Message {

    @Autowired
    private MsgUtil msgUtil;

    @Autowired
    private RedisTemplate redisTemplate;

    @KafkaListener(topics = "1904",id = "ack",containerFactory = "ackContainerFactory")
    public void MyMessage(ConsumerRecord<String,String> date, Acknowledgment ack){
        String key = date.key();
        String value = date.value();

        Boolean aBoolean = redisTemplate.hasKey(key);
        if(aBoolean){
            System.out.println("消息重复了");
        }
        //消息没有重复 发送邮件
        msgUtil.sendTextEmail("1624846630@qq.com","你是美女",value);
        ack.acknowledge();
    }
}
*/
